package test26;

import java.util.Scanner;

class ScoreException extends Exception {
    public ScoreException(String message) {
        super(message);
    }
}

class Student {
    private double score;

    public void setScore(double score) throws ScoreException {
        if (score < 0 || score > 100)
            throw new ScoreException("成绩输入异常");
        else
            this.score = score;
    }

    public double getScore() {
        return this.score;
    }
}

public class Main {
    public static void main(String[] args){
        int login_1;
        Scanner sc = new Scanner(System.in);
        Student zhangsan = new Student();
        try
        {
            zhangsan.setScore(sc.nextDouble());
            System.out.println("成绩为" + zhangsan.getScore());
        }catch(ScoreException e) {
            System.out.println(e.getMessage());
        }finally {
            System.out.println("程序结束");
        }
        sc.close();
    }
}